﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Site.Master" CodeBehind="frmClienteEdit.aspx.cs"
    Inherits="ordserv.frmClienteEdit" %>

<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    <asp:FormView ID="FormView1" runat="server" DataKeyNames="IdCliente" DataSourceID="odsCliente"
        Width="828px">
        <EditItemTemplate>
            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update"
                Text="Update" />
            &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False"
                CommandName="Cancel" Text="Cancel" />
            <br />
            <br />
            <table style="width: 391px">
                <tr>
                    <td>
                        Codigo:
                    </td>
                    <td>
                        <asp:Label ID="IdClienteLabel1" runat="server" Text='<%# Eval("IdCliente") %>' />
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        Nome:
                    </td>
                    <td>
                        <asp:TextBox ID="NomeTextBox" runat="server" Text='<%# Bind("Nome") %>' />
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        CPF:
                    </td>
                    <td>
                        <asp:TextBox ID="CPFTextBox" runat="server" Text='<%# Bind("CPF") %>' />
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        Data Nascimento:
                    </td>
                    <td>
                        <asp:TextBox ID="DataNascimentoTextBox" runat="server" Text='<%# Bind("DataNascimento") %>' />
                        <asp:CompareValidator ID="CompareValidator1" runat="server" 
                            ControlToCompare="DataNascimentoTextBox" ErrorMessage="Data Inválida" 
                            Operator="DataTypeCheck" Type="Date">*</asp:CompareValidator>
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        Endereço:
                    </td>
                    <td>
                        <asp:TextBox ID="EnderecoTextBox" runat="server" Text='<%# Bind("Endereco") %>' />
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        Bairro:
                    </td>
                    <td>
                        <asp:TextBox ID="BairroTextBox" runat="server" Text='<%# Bind("Bairro") %>' />
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        CEP:
                    </td>
                    <td>
                        <asp:TextBox ID="CEPTextBox" runat="server" Text='<%# Bind("CEP") %>' />
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        idCidade
                    </td>
                    <td>
                        <asp:TextBox ID="IdCidadeTextBox" runat="server" Text='<%# Bind("IdCidade") %>' />
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        Telefone
                    </td>
                    <td>
                        <asp:TextBox ID="TelefoneTextBox" runat="server" Text='<%# Bind("Telefone") %>' />
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        e-mail:
                    </td>
                    <td>
                        <asp:TextBox ID="EmailTextBox" runat="server" Text='<%# Bind("Email") %>' />
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        Tipo:
                    </td>
                    <td>
                        <asp:TextBox ID="TipoTextBox" runat="server" Text='<%# Bind("Tipo") %>' />
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
            </table>
        </EditItemTemplate>
        <InsertItemTemplate>
            Nome:
            <asp:TextBox ID="NomeTextBox" runat="server" Text='<%# Bind("Nome") %>' />
            <br />
            CPF:
            <asp:TextBox ID="CPFTextBox" runat="server" Text='<%# Bind("CPF") %>' />
            <br />
            DataNascimento:
            <asp:TextBox ID="DataNascimentoTextBox" runat="server" Text='<%# Bind("DataNascimento") %>' />
            <br />
            Endereco:
            <asp:TextBox ID="EnderecoTextBox" runat="server" Text='<%# Bind("Endereco") %>' />
            <br />
            Bairro:
            <asp:TextBox ID="BairroTextBox" runat="server" Text='<%# Bind("Bairro") %>' />
            <br />
            CEP:
            <asp:TextBox ID="CEPTextBox" runat="server" Text='<%# Bind("CEP") %>' />
            <br />
            IdCidade:
            <asp:TextBox ID="IdCidadeTextBox" runat="server" Text='<%# Bind("IdCidade") %>' />
            <br />
            Telefone:
            <asp:TextBox ID="TelefoneTextBox" runat="server" Text='<%# Bind("Telefone") %>' />
            <br />
            Email:
            <asp:TextBox ID="EmailTextBox" runat="server" Text='<%# Bind("Email") %>' />
            <br />
            Tipo:
            <asp:TextBox ID="TipoTextBox" runat="server" Text='<%# Bind("Tipo") %>' />
            <br />
            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert"
                Text="Insert" />
            &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False"
                CommandName="Cancel" Text="Cancel" />
        </InsertItemTemplate>
    </asp:FormView>
    <asp:ObjectDataSource ID="odsCliente" runat="server" InsertMethod="Insert" SelectMethod="SelectByNome"
        TypeName="ordserv.Bussiness.ClienteBS" UpdateMethod="Update">
        <UpdateParameters>
            <asp:Parameter Name="IdCliente" Type="Int32" />
            <asp:Parameter Name="Nome" Type="String" />
            <asp:Parameter Name="cpf" Type="String" />
            <asp:Parameter Name="DataNascimento" Type="DateTime" />
            <asp:Parameter Name="Endereco" Type="String" />
            <asp:Parameter Name="Bairro" Type="String" />
            <asp:Parameter Name="CEP" Type="String" />
            <asp:Parameter Name="idCidade" Type="Int32" />
            <asp:Parameter Name="Telefone" Type="String" />
            <asp:Parameter Name="email" Type="String" />
            <asp:Parameter Name="tipo" Type="Int16" />
        </UpdateParameters>
        <SelectParameters>
            <asp:QueryStringParameter Name="Nome" QueryStringField="Id" Type="String" />
        </SelectParameters>
        <InsertParameters>
            <asp:Parameter Name="Nome" Type="String" />
            <asp:Parameter Name="cpf" Type="String" />
            <asp:Parameter Name="DataNascimento" Type="DateTime" />
            <asp:Parameter Name="Endereco" Type="String" />
            <asp:Parameter Name="Bairro" Type="String" />
            <asp:Parameter Name="CEP" Type="String" />
            <asp:Parameter Name="idCidade" Type="Int32" />
            <asp:Parameter Name="Telefone" Type="String" />
            <asp:Parameter Name="email" Type="String" />
            <asp:Parameter Name="tipo" Type="Int16" />
        </InsertParameters>
    </asp:ObjectDataSource>
</asp:Content>
